<template>
  <div class="page-header-index-wide">
    <div>
      <a-card v-if="isShow" style="margin-bottom:8px;" :bordered="false">
        <div class="menu-box" v-if="!disPLAY_none">
          <div @click="$router.push({ name: 'transformCourse' })" class="menu-item">
            <img src="~@/assets/img/zhuanke.png" alt />
            <div> 转课</div> 
           
          </div>
          <div @click="$router.push({ name: 'returnCourse' })" class="menu-item">
            <img src="~@/assets/img/tuike.png" alt />
            <div>退课</div> 
          </div>
          <div @click="$router.push({ name: 'returnItem' })" class="menu-item">
            <img src="~@/assets/img/tuiwuping.png" alt />
            <div>退物品</div> 
          </div>
          <div @click="$router.push({ name: 'returnCost' })" class="menu-item">
            <img src="~@/assets/img/returncost.png" alt />
            <div>退费用</div> 
          </div>
        </div>
      </a-card>

      <div class="account-settings-info-left" v-if="!disPLAY_none">
        <a-menu
          mode="horizontal"
          :selectedKeys="selectedKeys"
          type="inner"
          @openChange="onOpenChange"
        >
          <a-menu-item key="/finance/orderExpand/orderList" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'orderList' }">
              <div class="border_catainer_bottom">订单管理</div>
            </router-link>
          </a-menu-item>
          <a-menu-item
            key="/finance/orderExpand/orderdetails"
            class="border-cantainer"
            v-if="false"
          >
            <router-link :to="{ name: 'orderdetails' }">
              <div class="border_catainer_bottom">订单详情</div>
            </router-link>
          </a-menu-item>
          <a-menu-item key="/finance/order/receipt" class="border-cantainer" v-if="false">
            <router-link :to="{ name: 'receipt' }">
              <div class="border_catainer_bottom">打印详情</div>
            </router-link>
          </a-menu-item>
        </a-menu>
      </div>
      <div :class="disPLAY_none==true?'':'quittanceChildren'">
        <route-view></route-view>
      </div>
    </div>
  </div>
</template>
<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'
export default {
  components: {
    RouteView,
    PageView

  },
  mixins: [mixinDevice],
  data() {
    return {
      mode: 'inline',

      openKeys: [],
      selectedKeys: [],
      disPLAY_none: false,
      // cropper
      preview: {},


      pageTitle: '',
      isShow: true,
    }
  },
  mounted() {
    this.updateMenu()
    this.isShwoHeader()
  },
  methods: {
    onOpenChange(openKeys) {
      this.openKeys = openKeys
    },
    updateMenu(to) {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
      if (
        this.selectedKeys[0] == '/finance/orderExpand/orderdetails' ||
        this.selectedKeys[0] == '/finance/order/receipt'||
        this.selectedKeys[0] == '/finance/orderExpand/transformCourse' ||
        this.selectedKeys[0] == '/finance/orderExpand/returnCourse' ||
        this.selectedKeys[0] == '/finance/orderExpand/returnItem' ||
        this.selectedKeys[0] == '/finance/orderExpand/returnCost'      ) {
        this.disPLAY_none = true
      } else {
        this.disPLAY_none = false
      }
    },

    isShwoHeader() {
      if (this.$route.path == '/finance/orderExpand/orderList') {
        this.isShow = true
      }
    },
  },
  watch: {
    $route(val) {
      this.updateMenu()
    }
  }
}
</script>
<style lang="less">
.border-cantainer {
  padding: 0 10px;
  margin-right: 40px;
}
.menu-box {
  display: flex;
  align-items: center;
  .menu-item {
    width: 80px;
    margin-right: 20px;
    text-align: center;
    cursor: pointer;
    color: #333;
    img {
      width: 28px;
      height: 28px;
      margin-bottom: 8px;
    }
  }
}
</style>